import { buildService } from '../../helper/service'

// 值类型为String或Object,String为url(method),Object同axios(config)参数支持相同,data和params只能为对象类型
const settings = {
  getTreeData: {//wbs级联数据
    url: '/api/v1/project/wbs_list',
    method: 'get'
  },
  addOneProject: {
    url: '/api/v1/project/wbs',
    method: 'post'
  },
  //删除项目树形节点
  deleteProjectNode: {
    url: '/api/v1/project/wbs',
    method: 'delete'
  },
  //编辑节点
  editProjectNode: {
    url: '/api/v1/project/wbs',
    method: 'put'
  },
  //获取构件列表
  getMemberList: {
    url: '/api/v1/project/wbs_component_index',
    method: 'get'
  },
  //获取所有分配与未分配的构件列表
  getUnallocatedList: {
    url: '/api/v1/project/wbs_component_list',
    method: 'get'
  },
  //已分配移除构件
  removeMember: {
    url: '/api/v1/project/wbs_component',
    method: 'delete'
  },
  //未分配添加构件
  addMember: {
    url: '/api/v1/project/wbs_component',
    method: 'post'
  },
  //获取图表数据
  getTableData: {
    url: '/api/v1/project/wbs_component_chart',
    method: 'get'
  },
  //模板下载
  downLoadModel: {
    url: '/api/v1/project/wbs_template',
    method: 'get'
  },
  //导入模板
  uploadModel: {
    url: '/api/v1/project/wbs_import',
    method: 'post'
  },
  //获取模型
  getModel: {
    url: '/api/v1/project/wbs_attach',
    method: 'get'
  },
  //获取构件详情
  getMemberDetail: {
    url: '/api/v1/project/component_despara',
    method: 'get'
  },
  coverWbs: {//项目分解-初始化设计方wbs
    url: '/api/v1/project/cover_wbs',
    method: 'post'
  }
}

export default buildService(settings)
